package com.yueka.service.Impl;

import com.yueka.mapper.StudentFollowRecordMapper;
import com.yueka.mapper.StudentMapper;
import com.yueka.pojo.studentFollowRecord.StudentFollowRecord;
import com.yueka.service.StudentFollowRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class StudentFollowRecordServiceImpl implements StudentFollowRecordService {
    @Autowired
    private StudentFollowRecordMapper studentFollowRecordMapper;
    @Override
    public List<StudentFollowRecord> list(Integer studentId) {
        return studentFollowRecordMapper.list(studentId);
    }

    @Override
    public void insert(StudentFollowRecord studentFollowRecord) {
        studentFollowRecord.setCreateTime(LocalDateTime.now());
        studentFollowRecord.setUpdateTime(LocalDateTime.now());
        studentFollowRecordMapper.insert(studentFollowRecord);
    }

    @Override
    public void update(StudentFollowRecord studentFollowRecord) {
        studentFollowRecord.setUpdateTime(LocalDateTime.now());
        studentFollowRecordMapper.update(studentFollowRecord);
    }
}
